<?php

namespace App\Http\Controllers;

use App\Datatables;
use Illuminate\Http\Request;

/**
 * Class BehaviorLogController
 * @package App\Http\Controllers
 */
class BehaviorLogController extends Controller
{
    /**
     * BehaviorLogController constructor.
     */
    public function __construct()
    {
        $this->middleware('auth');
    }

    /**
     * 发帖和回帖数量
     * @param Request $request
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\JsonResponse|\Illuminate\View\View
     */
    public function behaviorLog(Request $request)
    {
        if ($request->isMethod('post')) {
            return response()->json(Datatables::BehaviorLog());
        }
        return view('behaviorLog.behaviorLog');
    }

    /**
     * 登录人数
     * @param Request $request
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\JsonResponse|\Illuminate\View\View
     */
    public function loginLog(Request $request)
    {
        if ($request->isMethod('post')) {
            return response()->json(Datatables::LoginLog());
        }
        return view('behaviorLog.loginLog');
    }
}
